/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.dp.vo;

import java.io.Serializable;
import java.util.Date;
import java.util.Set;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToMany;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import org.apache.struts2.json.annotations.JSON;

/**
 *
 * @author wyr
 */
@Entity
@Table(name = "news_catlog")
//@NamedQueries({@NamedQuery(name = "NewsCatlog.findAll", query = "SELECT n FROM NewsCatlog n"), @NamedQuery(name = "NewsCatlog.findByCatlogid", query = "SELECT n FROM NewsCatlog n WHERE n.catlogid = :catlogid"), @NamedQuery(name = "NewsCatlog.findByCatlogname", query = "SELECT n FROM NewsCatlog n WHERE n.catlogname = :catlogname"), @NamedQuery(name = "NewsCatlog.findByCatlogversion", query = "SELECT n FROM NewsCatlog n WHERE n.catlogversion = :catlogversion"), @NamedQuery(name = "NewsCatlog.findByCatlogcarrer", query = "SELECT n FROM NewsCatlog n WHERE n.catlogcarrer = :catlogcarrer"), @NamedQuery(name = "NewsCatlog.findByIsnowpublish", query = "SELECT n FROM NewsCatlog n WHERE n.isnowpublish = :isnowpublish"), @NamedQuery(name = "NewsCatlog.findByCreater", query = "SELECT n FROM NewsCatlog n WHERE n.creater = :creater"), @NamedQuery(name = "NewsCatlog.findByAuiter", query = "SELECT n FROM NewsCatlog n WHERE n.auiter = :auiter"), @NamedQuery(name = "NewsCatlog.findByCreatetime", query = "SELECT n FROM NewsCatlog n WHERE n.createtime = :createtime"), @NamedQuery(name = "NewsCatlog.findByFirstpageid", query = "SELECT n FROM NewsCatlog n WHERE n.firstpageid = :firstpageid")})
public class NewsCatlog implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "catlogid")
    private Integer catlogid;
    @Column(name = "catlogname")
    private String catlogname;
    @Column(name = "catlogversion")
    private Integer catlogversion;
    @Column(name = "catlogcarrer")
    private String catlogcarrer;
    @Column(name = "isnowpublish")
    private Integer isnowpublish;
    @Column(name = "creater")
    private String creater;
    @Column(name = "auiter")
    private String auiter;
    @Column(name = "createtime")
    @Temporal(TemporalType.TIMESTAMP)
    private Date createtime;
    @Column(name = "firstpageid")
    private String firstpageid;
    @ManyToMany(mappedBy = "newsCatlogSet")
    private Set<NewsButtons> newsButtonsSet;
    @ManyToMany(mappedBy = "newsCatlogSet")
    private Set<NewsExtendsFirstchannel> newsExtendsFirstchannelSet;
    @OneToMany(fetch = FetchType.EAGER,mappedBy = "catlogid")
    private Set<NewsCatlogPlatform> newsCatlogPlatformSet;

    public NewsCatlog() {
    }

    public NewsCatlog(Integer catlogid) {
        this.catlogid = catlogid;
    }

    public Integer getCatlogid() {
        return catlogid;
    }

    public void setCatlogid(Integer catlogid) {
        this.catlogid = catlogid;
    }

    public String getCatlogname() {
        return catlogname;
    }

    public void setCatlogname(String catlogname) {
        this.catlogname = catlogname;
    }

    public Integer getCatlogversion() {
        return catlogversion;
    }

    public void setCatlogversion(Integer catlogversion) {
        this.catlogversion = catlogversion;
    }

    public String getCatlogcarrer() {
        return catlogcarrer;
    }

    public void setCatlogcarrer(String catlogcarrer) {
        this.catlogcarrer = catlogcarrer;
    }

    public Integer getIsnowpublish() {
        return isnowpublish;
    }

    public void setIsnowpublish(Integer isnowpublish) {
        this.isnowpublish = isnowpublish;
    }

    public String getCreater() {
        return creater;
    }

    public void setCreater(String creater) {
        this.creater = creater;
    }

    public String getAuiter() {
        return auiter;
    }

    public void setAuiter(String auiter) {
        this.auiter = auiter;
    }

    public Date getCreatetime() {
        return createtime;
    }

    public void setCreatetime(Date createtime) {
        this.createtime = createtime;
    }

    public String getFirstpageid() {
        return firstpageid;
    }

    public void setFirstpageid(String firstpageid) {
        this.firstpageid = firstpageid;
    }
    @JSON(serialize=false)   
    public Set<NewsButtons> getNewsButtonsSet() {
        return newsButtonsSet;
    }

    public void setNewsButtonsSet(Set<NewsButtons> newsButtonsSet) {
        this.newsButtonsSet = newsButtonsSet;
    }
    @JSON(serialize=false)   
    public Set<NewsExtendsFirstchannel> getNewsExtendsFirstchannelSet() {
        return newsExtendsFirstchannelSet;
    }

    public void setNewsExtendsFirstchannelSet(Set<NewsExtendsFirstchannel> newsExtendsFirstchannelSet) {
        this.newsExtendsFirstchannelSet = newsExtendsFirstchannelSet;
    }
    @JSON(serialize=false)   
    public Set<NewsCatlogPlatform> getNewsCatlogPlatformSet() {
        return newsCatlogPlatformSet;
    }

    public void setNewsCatlogPlatformSet(Set<NewsCatlogPlatform> newsCatlogPlatformSet) {
        this.newsCatlogPlatformSet = newsCatlogPlatformSet;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (catlogid != null ? catlogid.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof NewsCatlog)) {
            return false;
        }
        NewsCatlog other = (NewsCatlog) object;
        if ((this.catlogid == null && other.catlogid != null) || (this.catlogid != null && !this.catlogid.equals(other.catlogid))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.dp.vo.NewsCatlog[catlogid=" + catlogid + "]";
    }

}
